<%@ Page Title="" Language="C#" MasterPageFile="~/Management.master" AutoEventWireup="true"
    CodeFile="search_user.aspx.cs" Inherits="management_User_search_user" EnableEventValidation="false" %>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:ScriptManager runat="server" ID="smgrUser" EnablePartialRendering="true">
    </asp:ScriptManager>
    <div class="contents">
        <table width="100%" cellpadding="3" cellspacing="0" border="0">
            <tr>
                <td colspan="2">
                    <h1>
                        Search User by Email</h1>
                </td>
            </tr>
            <tr id="trSearch" runat="server">
                <td>
                    <b>User Type</b> :
                    <asp:DropDownList ID="ddlUserType" runat="server">
                        <asp:ListItem Text="Customer" Value="400"></asp:ListItem>
                        <asp:ListItem Text="Provider" Value="300"></asp:ListItem>
                        <asp:ListItem Text="Site User" Value="200"></asp:ListItem>
                    </asp:DropDownList>
                    <b>User Email</b> :
                    <asp:TextBox ID="txtEmail" runat="server" Width="300px"></asp:TextBox>&nbsp;
                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Submit" Width="100px" />&nbsp;
                    <asp:Button ID="btnLogout" runat="server" Text="Log Out" OnClick="btnLogout_Click" Visible="false" />
                    <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Clear" Width="100px"
                        Visible="false" />&nbsp;&nbsp;&nbsp;
                    <asp:Label runat="server" ID="lblRecordCount" Text=""></asp:Label>
                </td>
            </tr>
            <tr id="trReject" runat="server" align="right">
                <td align="right">
                </td>
                <td>
                    <asp:CheckBox runat="server" Text="Is Reject Email" ID="chkReject" />&nbsp;
                    <asp:Button ID="btnReject" runat="server" Text="Update" OnClick="btnReject_Click" />
                </td>
            </tr>
            <tr>
                <td colspan="2">
                    <asp:GridView ID="grvUser" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                        GridLines="None" CellPadding="2" DataKeyNames="CEID" CssClass="admin_gridstyle"
                        EmptyDataText="There are no data records to display." OnSelectedIndexChanged="grvUser_SelectedIndexChanged">
                        <FooterStyle />
                        <PagerStyle />
                        <Columns>
                            <asp:BoundField DataField="CEID" ItemStyle-Width="60px" HeaderText="ID" InsertVisible="False"
                                ReadOnly="True" SortExpression="CEID" />
                            <asp:BoundField ItemStyle-Width="80px" DataField="UserTypeDesc" HeaderText="User Type"
                                SortExpression="UserTypeDesc" ReadOnly="True" />
                            <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" />
                            <asp:BoundField DataField="SurName" ItemStyle-Width="275px" HeaderText="SurName"
                                SortExpression="SurName" />
                            <asp:BoundField DataField="Mobile" ItemStyle-Width="120px" HeaderText="Mobile No."
                                SortExpression="Mobile" />
                            <asp:BoundField DataField="Email" ItemStyle-Width="300px" HeaderText="Email" SortExpression="Email" />
                            <asp:BoundField DataField="AuthCode" ItemStyle-Width="150px" HeaderText="Password"
                                SortExpression="AuthCode" />
                            <asp:BoundField DataField="UsrTypeId" Visible="false" HeaderText="UsrTypeId" SortExpression="UsrTypeId" />
                            <asp:BoundField DataField="CreatedDate" DataFormatString="{0:dd/MM/yyyy hh:mm:ss tt}"
                                HeaderText="Register Date" SortExpression="CreatedDate" />
                            <asp:CheckBoxField DataField="IsReject" HeaderText="Is Reject" />
                            <asp:CommandField ShowSelectButton="True" />
                        </Columns>
                        <FooterStyle />
                        <PagerStyle />
                        <SelectedRowStyle BackColor="LightGray" />
                        <HeaderStyle CssClass="admin_gridheader" />
                        <EditRowStyle />
                        <AlternatingRowStyle CssClass="admin_gridodd" />
                        <RowStyle CssClass="admin_grideven" />
                    </asp:GridView>
                </td>
                <div style="display: none;">
                    <asp:TextBox ID="txtUserId" runat="server"></asp:TextBox>
                    <asp:TextBox ID="txtUserTypeId" runat="server"></asp:TextBox>
                </div>
            </tr>
            <tr>
                <td style="width: 100%;" colspan="2">
                    <div id="divQuotes" runat="server" class="w45p left pad_r20px">
                        <div class="left">
                            <span class="h">
                                <asp:Label ID="lblHeader" runat="server" Text="User Quotes Details"></asp:Label></span></div>
                        <br />
                        <div class="pad_r20px font_13px">
                            <asp:Label ID="lblMessage" runat="server" Text="This option for CX Customer Users only."
                                Visible="false"></asp:Label></div>
                        <asp:GridView ID="grvQuotesCount" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                            CellPadding="2" CssClass="admin_gridstyle" EmptyDataText="There are no data records to display."
                            GridLines="None" Width="75%" DataKeyNames="RefCEUserId,InsType" OnSelectedIndexChanged="grvQuotesCount_SelectedIndexChanged"
                            OnRowDataBound="grvQuotesCount_RowDataBound">
                            <FooterStyle />
                            <PagerStyle />
                            <Columns>
                                <asp:BoundField DataField="RefCEUserId" HeaderText="User ID" ReadOnly="True" />
                                <asp:BoundField DataField="InsType" HeaderText="Quote Type" ReadOnly="True" />
                                <asp:BoundField DataField="QuoteCount" HeaderText="No of Quotes" />
                                <asp:HyperLinkField DataNavigateUrlFields="QuoteUrl" Target="_blank" HeaderText="View"
                                    Text="View" />
                                <asp:HyperLinkField DataNavigateUrlFields="RefCEUserId" Target="_blank" HeaderText="CallMe" 
                                    Text="CallMe" DataNavigateUrlFormatString="~/user/callme-history.aspx?ceid={0}&menu=0" />
                            </Columns>
                            <FooterStyle />
                            <PagerStyle />
                            <SelectedRowStyle />
                            <HeaderStyle CssClass="admin_gridheader" />
                            <EditRowStyle />
                            <AlternatingRowStyle CssClass="admin_gridodd" />
                            <RowStyle CssClass="admin_grideven" />
                        </asp:GridView>
                    </div>
                    <div id="divProposal" runat="server" class="w45p left pad_r20px">
                        <div class="left">
                            <span class="h">
                                <asp:Label ID="lblProposalHeader" runat="server" Text="User Completed Proposal Details"></asp:Label></span></div>
                        <br />
                        <div class="pad_r20px font_13px">
                            <asp:Label ID="lblProposalMessage" runat="server" Text="This option for CX Customer Users only."
                                Visible="false"></asp:Label></div>
                        <asp:GridView ID="grvProposalCount" runat="server" AllowSorting="True" AutoGenerateColumns="False"
                            CellPadding="2" CssClass="admin_gridstyle" EmptyDataText="There are no data records to display."
                            GridLines="None" Width="75%" DataKeyNames="RefCEUserId,InsType" OnRowDataBound="grvProposalCount_RowDataBound">
                            <FooterStyle />
                            <PagerStyle />
                            <Columns>
                                <asp:BoundField DataField="RefCEUserId" HeaderText="User ID" ReadOnly="True" />
                                <asp:BoundField DataField="InsType" HeaderText="Insurance Type" ReadOnly="True" />
                                <asp:BoundField DataField="ProposalCount" HeaderText="No of Proposal" />
                                <asp:HyperLinkField DataNavigateUrlFields="ProposalUrl" Target="_blank" HeaderText="View"
                                    Text="View" />
                            </Columns>
                            <FooterStyle />
                            <PagerStyle />
                            <SelectedRowStyle />
                            <HeaderStyle CssClass="admin_gridheader" />
                            <EditRowStyle />
                            <AlternatingRowStyle CssClass="admin_gridodd" />
                            <RowStyle CssClass="admin_grideven" />
                        </asp:GridView>
                        <div style="display: none;">
                            <asp:TextBox ID="txtCEID" runat="server" Text="0"></asp:TextBox>
                        </div>
                        <div class="pad_r20px font_13px">
                            <asp:HyperLink Visible="false" ID="hplView" NavigateUrl="" runat="server" Target="_blank"
                                Text="View All Proposals" ToolTip="View All Proposals"></asp:HyperLink>
                        </div>
                    </div>
                </td>
            </tr>
        </table>
    </div>

    <script type="text/javascript">
        function OpenProposal(refid) {
            var winl = (screen.width - 500) / 2;
            var wint = (screen.height - 300) / 2;
            var settings = 'height=300,';
            settings += 'width=500,';
            settings += 'top=' + wint + ',';
            settings += 'left=' + winl + ',';
            settings += 'scrollbars=yes,';
            settings += 'resizable=No';
            window.open('user-info.aspx?Ref=' + refid, 'NEWWIN', settings);
        }
    </script>

    <script type="text/javascript">
        function OpenNewWindow(url) {
            var settings = 'scrollbars=yes,';
            settings += 'resizable=No';
            window.open(url, 'NEWWIN', settings);
        }
    </script>

</asp:Content>
